const vscode = require('vscode')


const statusbarItem = vscode.window.createStatusBarItem(
    vscode.StatusBarAlignment.Right,
    100
)
statusbarItem.text = `Vue2Blue`
statusbarItem.tooltip = `Vue2Blue`
statusbarItem.backgroundColor = undefined
statusbarItem.show()

function updateStatusBarItem(text, tooltip='', flag='') {
    statusbarItem.text = text
    if (tooltip === '') {
        tooltip = 'Vue2Blue'
    }
    if (flag === 'error') {
        statusbarItem.backgroundColor = new vscode.ThemeColor('statusBarItem.errorBackground')
    } else {
        statusbarItem.backgroundColor = undefined
    }
    statusbarItem.tooltip = tooltip
}

module.exports = {
    statusbarItem,
    updateStatusBarItem
}

